package com.candy.service.impl;

import com.candy.bean.UserInfo;
import com.candy.dao.UserInfoMapper;
import com.candy.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    UserInfoMapper userInfoMapper;

    /**
     * 根据用户名密码进行信息判断，数据库中存有对应信息，返回true，反之返回false
     * @param userInfo 用户名及密码信息
     * @return
     */
    @Override
    public boolean login(UserInfo userInfo) {
       List<UserInfo> ls= userInfoMapper.login(userInfo);
       if(ls!=null&&ls.size()>0){
           return true;
       }else {
           return false;
       }
    }
}
